<template>
	<view class="content">
		<view class="t tool1">
			<view class="title">内容策划</view>
			<view class="list">
				<view class="item" @click="toProjectSubmit">
					方案递交
				</view>
			</view>
		</view>
		<view class="t tool2">
			<view class="title">店铺工具</view>
			<view class="list">
				<view class="item" @click="toRemarkingOk">
					福利核销
				</view>
				<view class="item" @click="lookExchangeDetail">
					兑换详情
				</view>
				<view class="item" @click="toShopMarking">
					福利管理
				</view>
			</view>
		</view>
		
		<!-- 方案递交 -->
		<!-- <uni-popup ref="popupProjectSubmit" type="center" class="popup">
			<view class="popupCode-v">
				 <textarea placeholder-style="color:E6E6E6;border:1rpx solid #E6E6E6;width:100%;height:300rpx;" placeholder="占位符字体是红色的"/>
				 <view class="btn cancel">取消</view>
				 <view class="btn sub">提交</view>
			</view>
		</uni-popup> -->
		
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
				
			}
		},methods:{
			toShopMarking(){
				uni.navigateTo({
					url: 'shopMarking'
				});
			},
			lookExchangeDetail(){//兑换详情
				uni.navigateTo({
					url: 'shopExchangeDetail'
				});
			},
			toProjectSubmit(){
				uni.showModal({
				    title: '提示',
					showCancel:false,
				    content: '请在个人中心联系客服',
				    success: function (res) {
				    }
				});
			},toRemarkingOk(){
				let code = '';
				let that = this;
				uni.scanCode({
				    onlyFromCamera: true,
				    success: function (res) {
						code = res.result;
						
						//获取兑换信息
						let opts = {
							url: 'shoptool/exchangeMarking/'+code,
							method: 'get'
						};
						let param = {};
						that.tokenRequest(opts, param).then(res => {
							uni.hideLoading();
							let rData = res.data;
							uni.showModal({
							    title: '兑换信息',
							    content: '是否兑换：'+rData,
							    success: function (res) {
							        if (res.confirm) {
										 let opts = {
										 	url: 'shoptool/doExchangeMarking/'+code,
										 	method: 'post'
										 };
										 let param = {};
										 that.tokenRequest(opts, param).then(res => {
											 uni.hideLoading();
										 	let rMsg = res.msg;
										 	uni.showToast({
											    icon:'none',
										 	    title: rMsg,
										 	    duration: 1500
										 	});
										 }, error => {})
							        } else if (res.cancel) {
							          uni.showToast({
										  icon:'none',
							              title: '您取消了兑换',
							              duration: 1500
							          });
							        }
							    }
							});
							
						}, error => {})
						
				    }
				});
			}
		}
	}
</script>

<style>
	.content .t{
		background-color: #fff;
		margin-top: 20rpx;
		padding: 20rpx;
		margin: 20rpx;
		border-radius: 15rpx;
	}
	.list{
		display: flex;
		margin-top: 10rpx;
		flex-wrap: wrap;
	}
	.title{
		font-weight: 700;
	}
	.item{
		color: #fff;
		padding: 10rpx 15rpx;
		font-size: 30rpx;
		margin-top: 30rpx;
		border-radius: 10rpx;
		background-color: #007AFF;
		margin-left: 30rpx;
	}
	.popupCode-v{
		padding: 15rpx;
		background-color: #fff;
		border-radius: 15rpx;
	}
</style>
